package cn.iocoder.yudao.module.esim.enums.esasset;

import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * eSim激活状态
 *
 * @author lizhognwen
 */
@Getter
@AllArgsConstructor
public enum EsAssetDeviceTypeEnum implements IntArrayValuable {
    WIFI_DEVICE(0, "随身WIFI"),
    OTHER(1, "其他");

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(EsAssetDeviceTypeEnum::getValue).toArray();

    /**
     * 状态
     */
    private final Integer value;

    /**
     * 状态名
     */
    private final String desc;

    @Override
    public int[] array() {
        return ARRAYS;
    }

    public static EsAssetDeviceTypeEnum fromValue(Integer value) {
        for (EsAssetDeviceTypeEnum type : values()) {
            if (type.value.equals(value)) {
                return type;
            }
        }
        throw new IllegalArgumentException("枚举类型 EsAssetDeviceTypeEnum 不支持的值：" + value);
    }

}
